package com.explorati.design_pattern.hybrid.strategyfactory;

//策略工厂
public class StrategyFactory {

	public static IDeduction getDeduction(StrategyMan strategy) {
		if (strategy.getValue() == 1) {
			// 固定消费策略
			return new SteadyDeduction();
		} else if (strategy.getValue() == 2) {
			// 自由消费策略
			return new FreeDeduction();
		} else {
			return null;
		}
	}
}
